﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using AMing.Extension.Net40;

namespace MusicForMvc3.Method
{
    public class XiamiDecode : Xiami.Helper.Decode
    {
        public XiamiDecode()
        {
            enable_ToUrl = WebConfigurationManager.AppSettings["Enable_ToUrl"].To<bool>(false);
        }

        private bool enable_ToUrl = false;
        protected override string DecodeXmlUrl(string playerurl)
        {
            string xmlurl = base.DecodeXmlUrl(playerurl);
            if (enable_ToUrl)
            {
                xmlurl = "http://www.y2443.com/to?url={0}".ToFromat(System.Web.HttpUtility.UrlEncode(xmlurl));
            }

            return xmlurl;
        }
    }
}